package com.itheima.d4_byte_stream;

import java.io.*;

public class CopyTest5 {
    public static void main(String[] args) throws Exception {
        InputStream is =new FileInputStream("D:\\resourse\\th.jpg");
        OutputStream os =new FileOutputStream("C:\\data\\th2.jpg");

        byte[] bytes = new byte[1024];
        int len;
        while((len=is.read(bytes))!=-1){
            os.write(bytes,0,len);
        }
        os.close();
        is.close();
        System.out.println("拷贝成功!");

    }
}
